package com.vgemv.jsutilitysdk.Menu.JsMenuView.JsMenuItemVm;

import com.vgemv.jsutilitysdk.Menu.JsMenuView.JsMenuItemModelDefault;
import com.vgemv.jsutilitysdk.Menu.JsMenuView.JsMenuItemStyleDefault;
import com.vgemv.jsutilitysdk.Menu.JsMenuView.JsMenuItemStyle;

public class JsMenuItemVmDefault extends JsMenuItemVm {
        public JsMenuItemVmDefault() {
            super(2);
            JsMenuItemModelDefault model = new JsMenuItemModelDefault(0,"","",null);
            setModelAndStyle(model,null,null,null);
        }

        public JsMenuItemVmDefault(String title) {
            super(2);
            JsMenuItemModelDefault model = new JsMenuItemModelDefault(0,title,"",null);
            setModelAndStyle(model,null,null,null);
        }

        public JsMenuItemVmDefault(int index, String title) {
            super(2);
            JsMenuItemModelDefault model = new JsMenuItemModelDefault(index,title,"",null);
            setModelAndStyle(model,null,null,null);
        }

    public JsMenuItemVmDefault(int index, String title, String description) {
        super(2);
        JsMenuItemModelDefault model = new JsMenuItemModelDefault(index,title,description,null);
        setModelAndStyle(model,null,null,null);
    }

        public JsMenuItemVmDefault(Integer index, String title, String description, Integer width, Integer height) {
            super(2);
            JsMenuItemModelDefault model = new JsMenuItemModelDefault(index,title,description,null);
            JsMenuItemStyleDefault style = new JsMenuItemStyleDefault();
            style.mi_width = width;
            style.mi_height = height;
            setModelAndStyle(model,model,style,style);
        }


    public void setModelAndStyle(Object unselectedModel, Object selectedModel, JsMenuItemStyle unselectedStyle, JsMenuItemStyle selectedStyle) {
        if(selectedModel == null) {
            selectedModel = unselectedModel;
        }
        if(unselectedStyle == null) {
            unselectedStyle = new JsMenuItemStyleDefault();
        }
        if(selectedStyle == null) {
            selectedStyle = unselectedStyle;
        }
        setStyleForState(0,unselectedStyle);
        setStyleForState(1,selectedStyle);
        setModelForState(0,unselectedModel);
        setModelForState(1,selectedModel);
    }
}
